home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 25
/
AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso
/
Updates
/
PowerPC
/
pdflib
/
bind
/
perl
/
hello.pl
next >
Wrap
Perl Script
|
2000-05-16
|
701b
|
32 lines
#!/usr/bin/perl
# hello.pl
# Copyright (C) 1997-99 Thomas Merz. All rights reserved.
#
# PDFlib client: hello example in Perl
#
use pdflib 2.01;
package pdflib;
$p = PDF_new();
die "Couldn't open PDF file" if (PDF_open_file($p, "hello_pl.pdf") == -1);
PDF_set_info($p, "Creator", "hello.pl");
PDF_set_info($p, "Author", "Thomas Merz");
PDF_set_info($p, "Title", "Hello world (Perl)");
PDF_begin_page($p, 595, 842);
$font = PDF_findfont($p, "Helvetica-Bold", "default", 0);
die "Couldn't set font" if ($font == -1);
PDF_setfont($p, $font, 18.0);
PDF_set_text_pos($p, 50, 700);
PDF_show($p, "Hello world!");
PDF_continue_text($p, "(says Perl)");
PDF_end_page($p);
PDF_close($p);
PDF_delete($p);